/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package umf;

import analysis.Analytic;
import core.Constants;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;

/**
 *
 * @author Alexey Chirkov
 */
public class MainForm extends javax.swing.JFrame {

    /**
     * Creates new form MainForm
     */
    public MainForm() {
        initComponents();
        Draw();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroupFixed = new javax.swing.ButtonGroup();
        textSourceData = new javax.swing.JLabel();
        textThickness = new javax.swing.JLabel();
        valueThickness = new javax.swing.JTextField();
        textRadius = new javax.swing.JLabel();
        valueRadius = new javax.swing.JTextField();
        textBetta = new javax.swing.JLabel();
        valueBetta = new javax.swing.JTextField();
        textK = new javax.swing.JLabel();
        valueK = new javax.swing.JTextField();
        textC = new javax.swing.JLabel();
        valueC = new javax.swing.JTextField();
        textAlpha = new javax.swing.JLabel();
        valueAlpha = new javax.swing.JTextField();
        textU0 = new javax.swing.JLabel();
        valueU0 = new javax.swing.JTextField();
        textTimeEnd = new javax.swing.JLabel();
        valueTimeEnd = new javax.swing.JTextField();
        textP = new javax.swing.JLabel();
        valueP = new javax.swing.JTextField();
        sliderTime = new javax.swing.JSlider();
        textFixation = new javax.swing.JLabel();
        sliderR = new javax.swing.JSlider();
        radioButtonR = new javax.swing.JRadioButton();
        radioButtonT = new javax.swing.JRadioButton();
        jPanel1 = new javax.swing.JPanel();
        textFurN = new javax.swing.JLabel();
        valueFurN = new javax.swing.JTextField();
        buttonOK = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Курсовая работа по УМФ");
        setResizable(false);

        textSourceData.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        textSourceData.setText("Исходные данные:");

        textThickness.setText("Толщина пластины");

        valueThickness.setText(Double.valueOf(core.Constants.getL()).toString());

        textRadius.setText("Радиус пластины");

        valueRadius.setText(Double.valueOf(core.Constants.getRadius()).toString());

        textBetta.setText("Коофицент поглощения");

        valueBetta.setText(Double.valueOf(core.Constants.getBetta()).toString());

        textK.setText("Коофицент теплопроводности");

        valueK.setText(Double.valueOf(core.Constants.getK()).toString());

        textC.setText("Теплоемкость");

        valueC.setText(Double.valueOf(core.Constants.getC()).toString());

        textAlpha.setText("Коофицент теплоотвода");

        valueAlpha.setText(Double.valueOf(core.Constants.getAlpha()).toString());

        textU0.setText("Начальная температура");

        valueU0.setText(Double.valueOf(core.Constants.getU0()).toString());

        textTimeEnd.setText("Конечное время");

        valueTimeEnd.setText(Double.valueOf(core.Constants.getTimeEnd()).toString());

        textP.setText("Мощность излучения");

        valueP.setText(Double.valueOf(core.Constants.getP()).toString());

        sliderTime.setMaximum(180);
        sliderTime.setValue(180);
        sliderTime.setEnabled(false);
        sliderTime.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                sliderTimeStateChanged(evt);
            }
        });

        textFixation.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        textFixation.setText(" Фиксировать по");

        sliderR.setMaximum(40);
        sliderR.setValue(0);
        sliderR.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                sliderRStateChanged(evt);
            }
        });

        buttonGroupFixed.add(radioButtonR);
        radioButtonR.setText("по r=0");
        radioButtonR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radioButtonRActionPerformed(evt);
            }
        });

        buttonGroupFixed.add(radioButtonT);
        radioButtonT.setSelected(true);
        radioButtonT.setText("по t=0");
        radioButtonT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radioButtonTActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 512, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        textFurN.setText("Количество членов ряда");

        valueFurN.setText(Integer.toString(Analytic.getN()));
        valueFurN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                valueFurNActionPerformed(evt);
            }
        });

        buttonOK.setText("OK");
        buttonOK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonOKActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(textFurN)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(valueFurN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonOK, javax.swing.GroupLayout.PREFERRED_SIZE, 62, Short.MAX_VALUE))
                    .addComponent(textSourceData, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(textBetta)
                                    .addGap(52, 52, 52))
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(textThickness, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(textRadius))
                                    .addGap(18, 18, 18)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(textC)
                                    .addComponent(textAlpha)
                                    .addComponent(textU0)
                                    .addComponent(textTimeEnd)
                                    .addComponent(textP)
                                    .addComponent(textK))
                                .addGap(55, 55, 55)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(valueThickness, javax.swing.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE)
                            .addComponent(valueRadius, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                            .addComponent(valueBetta, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                            .addComponent(valueK, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                            .addComponent(valueC, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                            .addComponent(valueAlpha, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                            .addComponent(valueU0, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                            .addComponent(valueTimeEnd, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                            .addComponent(valueP, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)))
                    .addComponent(textFixation, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(radioButtonR)
                            .addComponent(radioButtonT))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(sliderR, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(sliderTime, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addGap(18, 18, 18)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(textSourceData)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textThickness)
                            .addComponent(valueThickness, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textRadius)
                            .addComponent(valueRadius, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(valueBetta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(textBetta))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(valueK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(textK))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textC)
                            .addComponent(valueC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textAlpha)
                            .addComponent(valueAlpha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textU0)
                            .addComponent(valueU0, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textTimeEnd)
                            .addComponent(valueTimeEnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(11, 11, 11)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textP)
                            .addComponent(valueP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(textFixation)
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(radioButtonR)
                            .addComponent(sliderR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(sliderTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(radioButtonT)))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textFurN)
                    .addComponent(valueFurN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonOK))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void sliderTimeStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sliderTimeStateChanged
        // TODO add your handling code here:
        radioButtonT.setText("по t=" + Integer.toString(sliderTime.getValue()));
        Draw();
    }//GEN-LAST:event_sliderTimeStateChanged

    private void sliderRStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sliderRStateChanged
        // TODO add your handling code here:
        radioButtonR.setText("по r=" + Double.toString(sliderR.getValue() / 10.0));
        Draw();
    }//GEN-LAST:event_sliderRStateChanged

    private void radioButtonRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioButtonRActionPerformed
        // TODO add your handling code here:
        sliderR.setEnabled(true);
        sliderTime.setEnabled(false);
        Draw();
    }//GEN-LAST:event_radioButtonRActionPerformed

    private void radioButtonTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioButtonTActionPerformed
        // TODO add your handling code here:
        sliderR.setEnabled(false);
        sliderTime.setEnabled(true);
        Draw();
    }//GEN-LAST:event_radioButtonTActionPerformed

    private void valueFurNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_valueFurNActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_valueFurNActionPerformed

    private void buttonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOKActionPerformed
        // TODO add your handling code here:
        try {
            int newN = Integer.parseInt(valueFurN.getText());
            Analytic.setN(newN);
            Draw();
        } catch (Exception ex) {
            System.out.println("Неправльное число");
        }
    }//GEN-LAST:event_buttonOKActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainForm().setVisible(true);
            }
        });
    }

    private void Draw() {
        XYSeriesCollection dataset = new XYSeriesCollection();
        XYSeries analytic = null;
        JFreeChart chart = null;
        if (radioButtonR.isSelected()) {
            analytic = DrawAnalyticOnR(sliderR.getValue() / 10.0);
            dataset.addSeries(analytic);
            chart = ChartFactory.createXYLineChart(
                    "U(r,t) r=" + sliderR.getValue() / 10.0 + " см", // Title
                    "t", // x-axis Label
                    "U", // y-axis Label
                    dataset, // Dataset
                    PlotOrientation.VERTICAL, // Plot Orientation
                    true, // Show Legend
                    true, // Use tooltips
                    false // Configure chart to generate URLs?
                    );
        } else {
            analytic = DrawAnalyticOnT(sliderTime.getValue());
            dataset.addSeries(analytic);
            chart = ChartFactory.createXYLineChart(
                    "U(r,t) t=" + sliderTime.getValue() + " c", // Title
                    "r", // x-axis Label
                    "U", // y-axis Label
                    dataset, // Dataset
                    PlotOrientation.VERTICAL, // Plot Orientation
                    true, // Show Legend
                    true, // Use tooltips
                    false // Configure chart to generate URLs?
                    );
        }
        jPanel1.removeAll();
        jPanel1.setLayout(new java.awt.BorderLayout());
        ChartPanel CP = new ChartPanel(chart);
        jPanel1.add(CP, BorderLayout.CENTER);
        jPanel1.validate();

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroupFixed;
    private javax.swing.JButton buttonOK;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JRadioButton radioButtonR;
    private javax.swing.JRadioButton radioButtonT;
    private javax.swing.JSlider sliderR;
    private javax.swing.JSlider sliderTime;
    private javax.swing.JLabel textAlpha;
    private javax.swing.JLabel textBetta;
    private javax.swing.JLabel textC;
    private javax.swing.JLabel textFixation;
    private javax.swing.JLabel textFurN;
    private javax.swing.JLabel textK;
    private javax.swing.JLabel textP;
    private javax.swing.JLabel textRadius;
    private javax.swing.JLabel textSourceData;
    private javax.swing.JLabel textThickness;
    private javax.swing.JLabel textTimeEnd;
    private javax.swing.JLabel textU0;
    private javax.swing.JTextField valueAlpha;
    private javax.swing.JTextField valueBetta;
    private javax.swing.JTextField valueC;
    private javax.swing.JTextField valueFurN;
    private javax.swing.JTextField valueK;
    private javax.swing.JTextField valueP;
    private javax.swing.JTextField valueRadius;
    private javax.swing.JTextField valueThickness;
    private javax.swing.JTextField valueTimeEnd;
    private javax.swing.JTextField valueU0;
    // End of variables declaration//GEN-END:variables

    private XYSeries DrawAnalyticOnR(double r) {
        XYSeries series = new XYSeries("Аналитическое решение");
        double eps = 1;


        double val = 0;
        while (!(val >= Constants.getTimeEnd()+eps)) {
            try {
                //double temp=Constants.getU0()-Analytic.getValueAt(4, val, eps);
                double temp=0;
                series.add(val, Analytic.getValueAt(r, val, eps));
            } catch (Exception ex) {
            }
            val += eps;
        }

        return series;

    }

    private XYSeries DrawAnalyticOnT(double t) {
        XYSeries series = new XYSeries("Аналитическое решение");
        double eps = 0.01;

        double val = 0;
        while (!(val >= Constants.getRadius()+eps)) {
            try {
                //double temp=Constants.getU0()- Analytic.getValueAt(4, t, eps);
                double temp=0;
                series.add(val, Analytic.getValueAt(val, t, eps));
            } catch (Exception ex) {
            }
            val += eps;
        }

        return series;

    }
}
